#pragma once

#include <d3d9.h>
#include <d3dx9.h>
#include <windows.h>
#include <strsafe.h>
#include <Windows.h>
#include <mmsystem.h>
#include "MyCam.h"
#include "Vertex.h"
#include <list>
#include "SceneRoot.h"
#include "VertBuffer.h"

class GraphicsEngine
{
public:
	LPDIRECT3D9 pD3D; 
	LPDIRECT3DDEVICE9 pd3dDevice;
	LPDIRECT3DVERTEXBUFFER9 pVB;
	LPD3DXMATRIXSTACK matStack;

	GraphicsEngine(HWND hWnd, MyCam& Cam);
	~GraphicsEngine(void);
	LRESULT Update(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
	VOID GraphicsEngine::Render(std::list<SceneRoot*> lFromTree);
private:
	MyCam* TestCam;

	VertBuffer VertBuff;
	HRESULT GraphicsEngine::InitD3D(HWND hWnd);
	//HRESULT GraphicsEngine::InitVB();
	HRESULT GraphicsEngine::UpdateWorld();
	void GraphicsEngine::InitCam();
	void GraphicsEngine::SetUpLights();
};
